//package com.plian.system.service.fr.cluemanagement.impl;
//
//import com.plian.Tools.CollectionUtil;
//import com.plian.system.entity.fr.cluemanagement.ClueCollect;
//import com.plian.system.entity.fr.cluemanagement.ClueCompanyReview;
//import com.plian.system.entity.fr.cluemanagement.ClueManagement;
//import com.plian.system.mapper.fr.cluemanagement.ClueCollectMapper;
//import com.plian.system.mapper.fr.cluemanagement.ClueCompanyReviewMapper;
//import com.plian.system.mybatis.base.BaseService;
//import com.plian.system.mybatis.base.BaseServiceImpl;
//import com.plian.system.service.fr.cluemanagement.IClueCollectService;
//import com.plian.system.service.fr.cluemanagement.IClueCompanyReviewService;
//import com.plian.system.service.sys.file.FileService;
//import lombok.AllArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Service;
//
//import java.util.Optional;
//
//@Service
//@Slf4j
//@AllArgsConstructor
//public class ClueCompanyReviewServiceImpl extends BaseServiceImpl<ClueCompanyReviewMapper, ClueCompanyReview> implements IClueCompanyReviewService {
//
//    private FileService fileService;
//
//    @Override
//    public boolean submit(ClueCompanyReview clueCompanyReview, ClueManagement clueManagement) {
//        boolean companyReviewFlag = false;
//        if (!Optional.ofNullable(clueCompanyReview.getId()).isPresent()) {
//            companyReviewFlag = true;
//            clueCompanyReview.setClueManagementId(String.valueOf(clueManagement.getId()));
//        }
//        boolean result = super.saveOrUpdate(clueCompanyReview);
//        // 上传附件
//        if (CollectionUtil.isNotEmpty(clueCompanyReview.getDocList())) {
//            if (companyReviewFlag) {
//                fileService.saveAll(String.valueOf(clueCompanyReview.getId()), clueCompanyReview.getDocList());
//            } else {
//                fileService.edit(String.valueOf(clueCompanyReview.getId()), clueCompanyReview.getDocList());
//            }
//        }
//        return result;
//    }
//}
